home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 34 / 034.d81 / calendar maker (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  4KB  |  136 lines

  1. 100 print"[147]"chr$(142);:poke53280,.:poke53281,.
  2. 110 dim c$(42),d$(31),m$(12),n(12),dn$(7),g$(10)
  3. 120 print"           [155]loadstar presents:"
  4. 130 print spc(13);"[159]calendar maker"
  5. 140 print"[150]             by mark haugan"
  6. 150 print"           (c) copyright 1987"
  7. 160 for i=1 to 31:read d$(i):next i
  8. 170 for i=1 to 12:read m$(i):next i
  9. 180 for i=1 to 12:read n(i):next i
  10. 190 for i=1 to 7:read dn$(i):next i
  11. 200 print" for what month and year do you wish to"
  12. 210 print"print the calendar?"
  13. 220 print"[154]enter month, q [154]to quit:          [157][157][157][157][157][157][157][157][157][157]";:mm=9:gosub1090:m$=a$
  14. 230 ifm$=""thenprint"[145]";:goto220
  15. 240 ifm$="q"thengosub1190:goto220
  16. 250 m=val(m$):if m>0 and m<13 then 290
  17. 260 fori=1to12:if(m$=left$(m$(i),len(m$)))thenm=i:goto280
  18. 270 next:print:gosub1000:gosub1020:goto220
  19. 280 ifi=13thenprint"[145]";:goto220
  20. 290 print"[154] enter year, q [154]to quit:        [157][157][157][157][157][157][157][157]";:mm=4:gosub1090:y=val(a$)
  21. 300 ifa$="q"thengosub1190:goto290
  22. 310 if(y<0)or(a$="")thenprint"[145]";:goto290
  23. 320 ify<100theny=y+1900
  24. 330 rem printer check
  25. 340 :
  26. 350 print"[159]  be sure your printer is turned on!"
  27. 360 print"[159]  press space [159]to continue, q [159]to quit."
  28. 370 geta$:ifa$<>" "anda$<>"q"anda$<>"[209]"then 370
  29. 380 ifa$="q"ora$="[209]"thengosub1190:goto360
  30. 390 open15,4,15:close15:ifst<>.thengosub1050:goto370
  31. 400 ifval(m$)>0thenm$=m$(val(m$))
  32. 402 p$=m$+","+str$(y):ta=20-(len(p$)/2)
  33. 405 print"[129]        printing calendar for ":printtab(ta)p$:print
  34. 410 gosub1080
  35. 420 j=367*y-int(7*(y+int((m+9)/12))/4)+int(275*m/9)+1721031
  36. 430 k=0:if m<=2 then k=-1
  37. 440 j=j-int(3*(int((y+k)/100)+1)/4)
  38. 450 k=n(m):if m<>2 then 500
  39. 460 w=int(y-100*int(y/100)):x=int(y-4*int(y/4)):z=int(y-400*int(y/400))
  40. 470 if x<>0 then 500
  41. 480 if w=0 and z<>0 then 500
  42. 490 k=29
  43. 500 x=j-7*int(j/7)
  44. 510 geta$:ifa$="q"ora$="[209]"thengosub1300:gosub1080
  45. 520 h$="-----------"
  46. 530 for i=0 to 42:c$(i)="[165]          ":next i
  47. 540 geta$:ifa$="q"ora$="[209]"thengosub1300:gosub1080
  48. 550 for i=1 to k:c$(i+x)=d$(i)+"        ":next i
  49. 560 rem open printer channel
  50. 570 open4,4
  51. 580 rem print title
  52. 590 geta$:ifa$="q"ora$="[209]"thengosub1300:gosub1080
  53. 600 if i+x<=36 then f5=1:for i=1 to 5:print#4:next i
  54. 610 t$=m$(m)+str$(y):c=20-len(t$)/2:print#4,chr$(14);
  55. 620 for i=1 to c:print#4," ";:next i
  56. 630 geta$:ifa$="q"ora$="[209]"thengosub1300:gosub1080
  57. 640 print#4,t$:print#4,chr$(15):print#4
  58. 650 rem print day names
  59. 660 for i=1 to 7:geta$:ifa$="q"ora$="[209]"thengosub1300:gosub1080
  60. 665 print#4,dn$(i);:next i:print#4
  61. 670 rem print main calendar
  62. 680 for i=1 to 5:j=7*i
  63. 690 geta$:ifa$="q"ora$="[209]"thengosub1300:gosub1080
  64. 700 for l=1 to 7:geta$:ifa$="q"ora$="[209]"thengosub1300:gosub1080
  65. 705 print#4,h$;:next l:print#4
  66. 710 geta$:ifa$="q"ora$="[209]"thengosub1300:gosub1080
  67. 720 for l=6 to 0 step -1:geta$:ifa$="q"ora$="[209]"thengosub1300:gosub1080
  68. 725 print#4,c$(j-l);:next l:print#4,"[165]"
  69. 730 geta$:ifa$="q"thengosub1300:gosub1080
  70. 740 for l=1 to 7:for n=1 to 7:geta$:ifa$="q"thengosub1300:gosub1080
  71. 745 print#4,c$(0);:next n:print#4,"[165]":next l
  72. 750 geta$:ifa$="q"ora$="[209]"thengosub1300:gosub1080
  73. 760 next i
  74. 770 if f5=1 then 820
  75. 780 j=42
  76. 790 for k=1 to 7:print#4,h$;:next k:print#4
  77. 800 for k=6 to 0 step -1:print#4,c$(j-k);:next k:print#4,"[165]"
  78. 810 for k=1 to 7:for l=1 to 7:print#4,c$(0);:next l:print#4,"[165]":next k
  79. 820 for k=1 to 7:print#4,h$;:next k:print#4
  80. 830 rem close printer channel and quit
  81. 840 print#4:close4
  82. 842 print"[145][145]   would you like to print another copy"
  83. 843 print"        of this year and month?"
  84. 844 poke198,0:wait198,1:geta$:ifa$<>"y"anda$<>"[217]"anda$<>"n"anda$<>"[206]"then844
  85. 845 ifa$="y"ora$="[217]"then350
  86. 846 :
  87. 850 print"[153][145][145]    would you like to print another?    "
  88. 860 print"[145]                                       "
  89. 870 geta$:ifa$<>"y"anda$<>"n"anda$<>"[217]"anda$<>"[206]"then870
  90. 880 ifa$="y"ora$="[217]"thenrun
  91. 890 ifa$="n"ora$="[206]"then1230
  92. 900 rem data
  93. 910 data "[165] 1","[165] 2","[165] 3","[165] 4","[165] 5","[165] 6","[165] 7","[165] 8","[165] 9","[165]10"
  94. 920 data "[165]11","[165]12","[165]13","[165]14","[165]15","[165]16","[165]17","[165]18","[165]19","[165]20"
  95. 930 data "[165]21","[165]22","[165]23","[165]24","[165]25","[165]26","[165]27","[165]28","[165]29","[165]30","[165]31"
  96. 940 data "january","february","march","april"
  97. 950 data "may","june","july","august","september"
  98. 960 data "october","november","december"
  99. 970 data 31,28,31,30,31,30,31,31,30,31,30,31
  100. 980 data "   sunday  ","   monday  ","  tuesday  "," wednesday "
  101. 990 data "  thursday ","   friday  ","  saturday "
  102. 1000 ok=.:fora=1to12:if(m$=m$(a))or(m$=left$(m$(a),3))thenok=-1:return
  103. 1010 next:return
  104. 1020 print"          error: invalid month"
  105. 1030 fora=1to2000:next:print"[145]                                       [145][145][145]"
  106. 1040 return
  107. 1050 print"   error: your printer is not online!"
  108. 1060 fora=1to2000:next
  109. 1070 print"[145]                                       [145][145][145]":return
  110. 1080 print"        [154]press and hold q [154]to quit.     ":return
  111. 1090 print"[164]";:fora=1tomm+1:g$(a)=""
  112. 1100 geta$:ifa$=""then1100
  113. 1110 ifa$=chr$(13)then1170
  114. 1120 if(a$=chr$(20))and(a>1)thena=a-1:print"[157][157]  [157][157][164]";:g$(a)="":goto1100
  115. 1125 if(a=mm+1)then1100
  116. 1130 if(a$>=" ")and(a$<="_")then1160
  117. 1140 if(a$>="[193]")and(a$<="[218]")thena$=chr$(asc(a$)-128):goto1160
  118. 1150 goto1100
  119. 1160 print"[157] [157]"a$;:poke212,.:print"[164]";:g$(a)=a$:next
  120. 1170 print"[157] ":a$="":forb=1toa-1:a$=a$+g$(b):next
  121. 1180 return
  122. 1190 print"[145][154]  are you sure you want to quit? (y[154]/n[154])"
  123. 1200 geta$:ifa$<>"y"anda$<>"n"anda$<>"[217]"anda$<>"[206]"then1200
  124. 1210 ifa$="y"ora$="[217]"then1230
  125. 1220 print"[145]                                      ":print"[145]";:return
  126. 1230 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
  127. 1240 print"[147]";:ifer<>63thenend
  128. 1250 load"hello connect",8
  129. 1260 :
  130. 1300 rem other quit
  131. 1310 print"[145][154]  are you sure you want to quit? (y[154]/n[154])"
  132. 1320 geta$:ifa$<>"y"anda$<>"n"anda$<>"[217]"anda$<>"[206]"then1320
  133. 1330 ifa$="y"ora$="[217]"thenrun
  134. 1340 print"[145]";:return
  135. 1350 :
  136.